<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header">
</head>
<style>
	.columns{
		margin-left:10px;
	}
</style>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="col-sm-12">
			<div class="columns pull-left col-md-1 nopadding">
				<input class="hidden" id="searchYear" name="searchYear" th:value="${year}" >
				<select id="searchState" name="searchState" class="form-control" >
					<option value="">请选择状态</option>
					<option value="0">未开始</option>
					<option value="1">已考试</option>
					<option value="2">已收款</option>
					<option value="3">个人已返款</option>
					<option value="4">学校已返款</option>
					<option value="5">已完成</option>
				</select>
			</div>
			<div class="columns pull-left col-md-1 nopadding">
				<input id="searchName" type="text" class="form-control"
					   placeholder="学校名称">
			</div>
			<div class="columns pull-left col-md-1 nopadding">
				<input id="searchProvince" type="text" class="form-control"
					   placeholder="省份">
			</div>
<!--			<div class="columns pull-left col-md-1 nopadding">-->
<!--				<select id="searchYear" name="searchYear" class="form-control" >-->
<!--					<option value="">请选择年份</option>-->
<!--					<option value="2020">2020</option>-->
<!--					<option value="2021">2021</option>-->
<!--					<option value="2022">2022</option>-->
<!--					<option value="2023">2023</option>-->
<!--					<option value="2024">2024</option>-->
<!--					<option value="2025">2025</option>-->
<!--				</select>-->
<!--			</div>-->
			<div class="columns pull-left col-md-1 nopadding">
				<input id="searchRegionUserName" type="text" class="form-control"
					   placeholder="考评负责人">
			</div>
			<label class="layui-form-label" style="width:100px">考评时间:</label>
			<div class="columns pull-left nopadding">
			<div class="layui-inline" id="examinationDate">
				<div class="layui-input-inline" style="float:left">
					<input type="text" autocomplete="off" id="examStartDate" class="layui-input" placeholder="开始日期">
				</div>
				<div class="layui-form-mid">-</div>
				<div class="layui-input-inline" style="float:left">
					<input type="text" autocomplete="off" id="examEndDate" class="layui-input" placeholder="结束日期">
				</div>
			</div>
			</div>
			<div class="columns pull-left">
				<button class="btn btn-success" onclick="reLoad()">查询</button>
				<button shiro:hasPermission="jzweb:examinationCost:import" type="button" class="btn  btn-primary" onclick="downExcel()">
					<i class="fa fa-download" aria-hidden="true"></i>导出
				</button>
				<button  type="button" class="btn btn-danger" onclick="analysis()">
					<i class="fa fa-bar-chart" aria-hidden="true"></i>统计分析
				</button>
			</div>
		</div>
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div class="columns pull-left">
							<button shiro:hasPermission="jzweb:examinationCost:import" type="button"
									class="btn  btn-success"
									onclick="downExcelModel('/jzweb/examinationCost/downloadImportTemplate')">
								<i class="fa fa-download" aria-hidden="true"></i>下载导入模板
							</button>
							<button shiro:hasPermission="jzweb:examinationCost:batchRemove" type="button" class="btn  btn-danger"
								onclick="batchRemove()">
								<i class="fa fa-trash" aria-hidden="true"></i>删除
							</button>


						</div>
						<div class="columns pull-left" style="margin-left:4px">
							<form shiro:hasPermission="jzweb:examinationCost:import" id="importExcelForm" method="post"
								  enctype="multipart/form-data">
								<input class="form-control" style="width:200px" name="file" id="fileUrl" type="file">
							</form>
						</div>

						<div class="columns pull-left" style="margin-left:4px">
							<button shiro:hasPermission="jzweb:examinationCost:import" type="button"
									class="btn  btn-success"
									onclick="importExcel($('#fileUrl'),$('#importExcelForm'),'/jzweb/examinationCost/import')">
								<i class="fa fa-upload" aria-hidden="true"></i>导入
							</button>
						</div>

					</div>
					<table id="exampleTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>
	</div>
	<!--shiro控制bootstraptable行内按钮看见性 -->
		<div>
			<script type="text/javascript">
				var s_edit_h = 'hidden';
				var s_remove_h = 'hidden';
				var s_confirmation_h = 'hidden';
				var s_calc_h= 'hidden';
			</script>
		</div>
		<div shiro:hasPermission="jzweb:examinationCost:edit">
			<script type="text/javascript">
				s_edit_h = '';
			</script>
		</div>
		<div shiro:hasPermission="jzweb:examinationCost:remove">
			<script type="text/javascript">
				var s_remove_h = '';
			</script>
		</div>
		<div shiro:hasPermission="jzweb:examinationCost:confirmation">
			<script type="text/javascript">
				var s_confirmation_h = '';
			</script>
		</div>
		<div shiro:hasPermission="jzweb:examinationCost:calculate">
			<script type="text/javascript">
				var s_calc_h = '';
			</script>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script type="text/javascript" src="/js/webJs/jzweb/examinationCost/examinationCost.js"></script>
	<script>
		layui.use('laydate', function(){
			var laydate = layui.laydate;
			laydate.render({
				elem: '#searchExaminationYear'
				,type: 'year'
			});
			laydate.render({
				elem: '#examinationDate'
				//设置开始日期、日期日期的 input 选择器
				//数组格式为 2.6.6 开始新增，之前版本直接配置 true 或任意分割字符即可
				,range: ['#examStartDate', '#examEndDate']
			});
		})

		function analysis() {
			var index = layer.open({
				type: 2,
				title: '模板信息',
				maxmin: true,
				shadeClose: false, // 点击遮罩关闭层
				area: ['1000px', '720px'],
				content: '/jzweb/examinationCost/examinationCostAnalysis?year='+$('#searchYear').val()// iframe的url
			});
			layer.full(index);
		}
		function downExcelModel(url){
			window.location.href=url;
		}

		function downExcel() {
				layer.confirm('您确定要导出考试费用详情信息吗？', {
					btn1:function(index){
						var url='/jzweb/examinationCost/exportList?orgName='+$('#searchName').val()+'&&state='+$('#searchState').val()+'&&province='+$('#searchProvince').val() +
								'&&year='+$('#searchYear').val()+'&&regionUserName='+$('#searchRegionUserName').val()+'&&examStartDate='+$('#examStartDate').val()+'&&examEndDate='+$('#examEndDate').val();
						window.location.href = url;
						layer.close(index)
					}
				});
		}


	</script>
</body>
</html>